package com.lanhe.app.controller.kayu;

import com.lanhe.common.core.controller.BaseController;
import com.lanhe.common.core.domain.AjaxResult;
import com.lanhe.common.core.page.TableDataInfo;
import com.lanhe.product.domain.LhKayuProduct;
import com.lanhe.product.service.ILhKayuProductService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 卡鱼产品表(LhKayuProduct)表控制层
 *
 * @author zhanggl
 * @since 2023-12-22 18:01:05
 */
@RestController
@RequestMapping("/api/kayu")
public class ApiKayuProductController extends BaseController {

    /**
     * 服务对象
     */
    @Resource
    private ILhKayuProductService lhKayuProductService;

    /**
     * 分页查询所有数据
     */
    @GetMapping("/list")
    public TableDataInfo list(LhKayuProduct product) {
        startPage();
        List<LhKayuProduct> list = lhKayuProductService.selectKayuProductList(product);
        return getDataTable(list);
    }

    /**
     * 根据编号获取详细信息
     */
    @GetMapping(value = {"/", "/{productId}"})
    public AjaxResult getInfo(@PathVariable(value = "productId") Long productId) {
        return success(lhKayuProductService.selectKayuProductById(productId));
    }



}

